import React, { Component } from 'react'
import { connect } from 'dva';
import back from '@/assets/icons/back.png'
import styles from "./backRouter.less";
import { Icon, Button } from 'antd'
import { routerRedux } from 'dva/router';
import noData from '@/assets/icons/暂无数据.png'
import { formatMessage } from "umi-plugin-react/locale";
export class BackRoutr extends Component {
  state = {}

  componentDidMount() { }

  backRouter = () => {
    const { dispatch } = this.props;
    dispatch(routerRedux.push({ pathname: this.props.pathname }));
  }

  render() {
    return (
      <Button onClick={this.backRouter} icon="arrow-left">{formatMessage({ id: 'button.back' })}</Button>
    )
  }
}

export default connect(({ user }) => ({
  currentUser: user.currentUser,
}))(BackRoutr);
